package com.likou.written.huayu;

import java.util.*;

/**
 * Author: 陈桂明
 * Date: 2025/10/25 22:12
 * Description: huayu1
 */
public class huayu1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        String input = in.next();
        if (input == null || input.length() == 0) {
            System.out.println("");
            return;
        }
        Map<String, Integer> map = new HashMap<>();
        Queue<String> queue = new LinkedList<>();
        int n = input.length();
        for (int i = 0; i < n; i++) {
            String substring = input.substring(i, i + 1);
            map.put(substring, map.getOrDefault(substring, 0) + 1);
            if (!queue.contains(substring)) {
                queue.offer(substring);
            }
        }

        StringBuilder ans = new StringBuilder();
        while (!queue.isEmpty()) {
            String poll = queue.poll();
            ans.append(poll).append(map.get(poll));
        }

        System.out.println(ans);
    }
}
